//
//  YKNavigationController.m
//  youkan
//
//  Created by mac mini on 16/2/25.
//  Copyright © 2016年 Honsintech. All rights reserved.
//

#import "YKNavigationController.h"

@interface YKNavigationController ()

@end

@implementation YKNavigationController
//!>    设置导航栏中的title为橘色
+(void)initialize{
//    获取当前类下的UIbarButton
//    UIBarButtonItem *item =[UIBarButtonItem appearance];
    UIBarButtonItem *item = [UIBarButtonItem appearanceWhenContainedIn:self, nil];
//!>    设置富文本(字体，并不包含图片)
    NSMutableDictionary *titleAttr =[NSMutableDictionary dictionary];
    titleAttr[NSForegroundColorAttributeName]=[UIColor orangeColor];
    [item setTitleTextAttributes:titleAttr forState:UIControlStateNormal];
    // 设置不可用状态
    NSMutableDictionary *disableTextAttrs = [NSMutableDictionary dictionary];
    disableTextAttrs[NSForegroundColorAttributeName] = [UIColor colorWithRed:0.6 green:0.6 blue:0.6 alpha:0.5];
    disableTextAttrs[NSFontAttributeName] = titleAttr[NSFontAttributeName];
    [item setTitleTextAttributes:disableTextAttrs forState:UIControlStateDisabled];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
